package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-07-03
 * Time: 16:49
 */
public class ThreadDemo6 {
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            while (true) {
                System.out.println("Hello t");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }, "t线程");

        t.start();

        //jconsole中只能看见Thread0线程，看不到main线程，因为main线程已经执行结束了
    }
}
